package com.yy.job.utils.exception;

import com.yy.job.common.enums.ErrorCodeEnum;

public class YYJobRuntimeException extends RuntimeException{
	
	private static final long serialVersionUID = -6421290416973655855L;

	private String code;
	
	private String message;
	
	public YYJobRuntimeException(){
		
	}
	
	public YYJobRuntimeException(String message) {
		this.code = ErrorCodeEnum.CMN_RUNTIME_ERROR.getCode();
		this.message = message;
	}
	
	public YYJobRuntimeException(String code, String message) {
		this.code = code;
		this.message = message;
	}
	
	public YYJobRuntimeException(ErrorCodeEnum codeEnum, String...args) {
		this.code = codeEnum.getCode();
		this.message = codeEnum.getErrorMsg(args);
	}
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
